<include file="Public/base"/>
<body>
    <div class="page-container">
        <form action="" method="POST" class="form form-horizontal" id="commentFrom">
           
           
              <div class="row cl">
               
          
                <label class="form-label col-xs-4 col-sm-2">诊所：</label>
                <div class="formControls col-xs-4 col-sm-4">
                <span class="select-box">
                  <select class="select sex" size="1" name="clinic_id" id="clinic">
                  <volist name="clinic_res" id="data">
                    <option value="{$data.id}">{$data.clinic_name}</option>
                  </volist>
                  </select>
                </span>
                    <!-- <input type="text" name="sex" id="" placeholder="" value="{$sale.sex}" class="input-text"> -->
                </div>
                </div>
             <div class="row cl">
                <!--
            <volist name="saleman" id="data">
                    <option value="{$data.id}">{$data.real_name}</option>
                  </volist>
            -->
               
                    <!-- <input type="text" name="sex" id="" placeholder="" value="{$sale.sex}" class="input-text"> -->
               
                <label class="form-label col-xs-4 col-sm-2">签到人：</label>
                <div class="formControls col-xs-4 col-sm-4">
                <span class="select-box">
				  <select class="select sex" size="1" name="saleman_id" id="saleman">
                  <volist name="sale" id="data">
				    <option value="{$data.id}">{$data.real_name}</option>
				  </volist>
				  </select>
				</span>
                    <!-- <input type="text" name="sex" id="" placeholder="" value="{$sale.sex}" class="input-text"> -->
                </div>
               
      		
               
              
              

        <div class="row cl">
       			 <label class="form-label col-xs-2 col-sm-2">拜访时间：</label>
                <div class="formControls col-xs-9 col-sm-9">
                    <input type="text" name="sign_time" id="" placeholder="" value="{$res.sign_time|date='Y-m-d H:i:s',###}" class="input-text">
                </div>
            </div>
           
            <div class="row cl">
                <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
                    <button onClick="sub_save();" class="btn btn-secondary radius" type="button"> 提交</button>
                    <button onClick="layer_close();" class="btn btn-default radius" type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
                </div>
            </div>
        </form>
    </div>
    <script type="text/javascript" src="__JS__/Salemanager/area/jquery.provincesCity.js"></script>
    <script type="text/javascript" src="__JS__/Salemanager/area/provincesData.js"></script>

    <script type="text/javascript">
                        
                   
                        function sub_save()
                        {
						    
							$.ajax({
                                url: "",
                                type: 'POST',
                                data: $("#commentFrom").serialize(),
                                async: false,
                               
                                success: function (returndata) {

                                    window.alert(returndata.message);
                                    layer_close();
                                    window.location.href="/Admin/Work/Vista/index/key/SPGLGUANVISTA.html";

                                },
                                error: function (returndata) {
                                    alert(returndata);
                                }
                            });
                        }
                        /*
                         参数解释：
                         title	标题
                         url		请求的url
                         id		需要操作的数据id
                         w		弹出层宽度（缺省调默认值）
                         h		弹出层高度（缺省调默认值）
                         */
                        /*管理员-增加*/
                        function admin_add(title, url, w, h) {
                            layer_show(title, url, w, h);
                        }
                        /*管理员-删除*/
                        function admin_del(obj, id) {
                            layer.confirm('确认要删除吗？', function (index) {
                                //此处请求后台程序，下方是成功后的前台处理……

                                $(obj).parents("tr").remove();
                                layer.msg('已删除!', {icon: 1, time: 1000});
                            });
                        }
                        /*管理员-编辑*/
                        function admin_edit(title, url, id, w, h) {
                            layer_show(title, url, w, h);
                        }
                        /*管理员-停用*/
                        function admin_stop(obj, id) {
                            layer.confirm('确认要停用吗？', function (index) {
                                //此处请求后台程序，下方是成功后的前台处理……

                                $(obj).parents("tr").find(".td-manage").prepend('<a onClick="admin_start(this,id)" href="javascript:;" title="启用" style="text-decoration:none"><i class="Hui-iconfont">&#xe615;</i></a>');
                                $(obj).parents("tr").find(".td-status").html('<span class="label label-default radius">已禁用</span>');
                                $(obj).remove();
                                layer.msg('已停用!', {icon: 5, time: 1000});
                            });
                        }

                        /*管理员-启用*/
                        function admin_start(obj, id) {
                            layer.confirm('确认要启用吗？', function (index) {
                                //此处请求后台程序，下方是成功后的前台处理……


                                $(obj).parents("tr").find(".td-manage").prepend('<a onClick="admin_stop(this,id)" href="javascript:;" title="停用" style="text-decoration:none"><i class="Hui-iconfont">&#xe631;</i></a>');
                                $(obj).parents("tr").find(".td-status").html('<span class="label label-success radius">已启用</span>');
                                $(obj).remove();
                                layer.msg('已启用!', {icon: 6, time: 1000});
                            });
                        }
                        $(function(){

                              $("#clinic").val({$res['clinic_id']});
                              $("#saleman").val({$res['saleman_id']});
                        })
               
    </script>
</body>
</html>